package com.ruoyi.system.service.impl;

import com.ruoyi.common.core.text.Convert;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.JiajiaOrderSeparateAccounts;
import com.ruoyi.system.domain.vo.JiajiaOrderSeparateAccountsVo;
import com.ruoyi.system.mapper.JiajiaOrderSeparateAccountsMapper;
import com.ruoyi.system.service.IJiajiaOrderSeparateAccountsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 订单分账流水Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-03-17
 */
@Service
public class JiajiaOrderSeparateAccountsServiceImpl implements IJiajiaOrderSeparateAccountsService 
{
    @Autowired
    private JiajiaOrderSeparateAccountsMapper jiajiaOrderSeparateAccountsMapper;

    /**
     * 查询订单分账流水
     * 
     * @param id 订单分账流水主键
     * @return 订单分账流水
     */
    @Override
    public JiajiaOrderSeparateAccounts selectJiajiaOrderSeparateAccountsById(Long id)
    {
        return jiajiaOrderSeparateAccountsMapper.selectJiajiaOrderSeparateAccountsById(id);
    }

    /**
     * 查询订单分账流水列表
     * 
     * @param jiajiaOrderSeparateAccounts 订单分账流水
     * @return 订单分账流水
     */
    @Override
    public List<JiajiaOrderSeparateAccountsVo> selectJiajiaOrderSeparateAccountsList(JiajiaOrderSeparateAccounts jiajiaOrderSeparateAccounts)
    {
        return jiajiaOrderSeparateAccountsMapper.selectJiajiaOrderSeparateAccountsList(jiajiaOrderSeparateAccounts);
    }

    /**
     * 新增订单分账流水
     * 
     * @param jiajiaOrderSeparateAccounts 订单分账流水
     * @return 结果
     */
    @Override
    public int insertJiajiaOrderSeparateAccounts(JiajiaOrderSeparateAccounts jiajiaOrderSeparateAccounts)
    {
        jiajiaOrderSeparateAccounts.setCreateTime(DateUtils.getNowDate());
        return jiajiaOrderSeparateAccountsMapper.insertJiajiaOrderSeparateAccounts(jiajiaOrderSeparateAccounts);
    }

    /**
     * 修改订单分账流水
     * 
     * @param jiajiaOrderSeparateAccounts 订单分账流水
     * @return 结果
     */
    @Override
    public int updateJiajiaOrderSeparateAccounts(JiajiaOrderSeparateAccounts jiajiaOrderSeparateAccounts)
    {
        jiajiaOrderSeparateAccounts.setUpdateTime(DateUtils.getNowDate());
        return jiajiaOrderSeparateAccountsMapper.updateJiajiaOrderSeparateAccounts(jiajiaOrderSeparateAccounts);
    }

    /**
     * 批量删除订单分账流水
     * 
     * @param ids 需要删除的订单分账流水主键
     * @return 结果
     */
    @Override
    public int deleteJiajiaOrderSeparateAccountsByIds(String ids)
    {
        return jiajiaOrderSeparateAccountsMapper.deleteJiajiaOrderSeparateAccountsByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除订单分账流水信息
     * 
     * @param id 订单分账流水主键
     * @return 结果
     */
    @Override
    public int deleteJiajiaOrderSeparateAccountsById(Long id)
    {
        return jiajiaOrderSeparateAccountsMapper.deleteJiajiaOrderSeparateAccountsById(id);
    }
}
